package top.xana.acg.anime.inject

import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.scopes.ViewModelScoped
import kotlinx.coroutines.CoroutineDispatcher
import top.xana.acg.anime.database.AnimeDao
import top.xana.acg.anime.network.AnimeApi
import top.xana.acg.anime.repo.AnimeRepo

/**
 * @author xana
 * @date 2022/10/30 0030 12:47
 * @email cv4096@qq.com
 **/

@Module
@InstallIn(ViewModelComponent::class)
object RepositoryModule {

    @ViewModelScoped
    @Provides
    fun provideAnimeRepo(api: AnimeApi, dao: AnimeDao, ioDispatcher: CoroutineDispatcher) =
        AnimeRepo(api, dao, ioDispatcher)
}